<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<div>
		<p:panelGrid columns="2">  
		    <f:facet name="header"> 
		    	<div align="right">
			      	<p:commandLink value="Novo Contato" process="@this" actionListener="#{clienteMB.novoContato}" 
			        			   oncomplete="modalFormContato.show();" update=":idFormContato" style="margin:0"/> 
		    	</div>
		    </f:facet>  
		</p:panelGrid>
		<p:dataTable id="dataTableContato" var="contato" value="#{clienteMB.cliente.clienteContatoLista}" styleClass="width100 dataTableContato" >
			<p:column headerText="#{msg.id}">
				<h:outputText value="#{contato.id}" />
			</p:column>
			<p:column headerText="#{msg.tipo_contato}">
				<h:outputText value="#{contato.tipoContato}" />
			</p:column>
			<p:column headerText="#{msg.fone}">
				<h:outputText value="#{contato.telefone}" />
			</p:column>
			<p:column headerText="#{msg.fax}">
				<h:outputText value="#{contato.fax}" />
			</p:column>						
			<p:column>
				<p:commandButton value="#{msg.editar}"  oncomplete="modalFormContato.show()" update=":idFormContato"> 
					 <f:setPropertyActionListener value="#{contato}" target="#{clienteMB.contato}" />
				</p:commandButton>
			</p:column>
			<p:column>
				<p:commandButton value="#{msg.excluir}" id="excluir" action="#{clienteMB.excluirContato}" update="@form" immediate="true">
					<f:setPropertyActionListener value="#{contato}" target="#{clienteMB.contato}" />
				</p:commandButton>
			</p:column>
		</p:dataTable>
	</div>

</ui:composition>